package com.yan.demo.arrydemo;

import java.util.Arrays;
import java.util.Random;

public class ArrayTest10 {
    public static void main(String[] args) {
        int[] arr = new int[5];
        int min;
        Random r = new Random();
        for (int i = 0; i < arr.length; i++) {
            arr[i] = r.nextInt(100) + 1;
        }
        min = arr[0];
        for (int i = 0; i < arr.length; i++) {
            if(min > arr[i]){
                min = arr[i];
            }
        }
        System.out.println(Arrays.toString(arr));
        System.out.println("min = " + min);
    }
}
